import request from '@/utils/request';

/**
 * 封装与楼栋相关的接口
 */
type getBuildingParams = {
  page?: number;
  pageSize?: number;
};
//  获取楼栋列表信息
export const getBuildingsList = (params: getBuildingParams) =>
  request({ url: '/admin/buildings/list', params });
// 新增/修改楼栋
export const postBuildingsEdit = (data: any) =>
  request({ url: '/admin/buildings/edit', method: 'post', data });
// 删除楼栋
export const deleteBuildingsDelete = (id: number) =>
  request({ url: '/admin/buildings/delete', method: 'delete', data: { id } });
// 获取楼栋信息
export const getBuildingsView = (id: number) =>
  request({ url: '/admin/buildings/view', params: { id } });
/**
 * 以下是封装与房型相关的接口
 */
// 获取房型列表信息
export const getRoomTypeList = () => request({ url: '/admin/roomType/list' });
// 新增/修改房型
export const postRoomTypeEdit = (data: any) =>
  request({ url: '/admin/roomType/edit', method: 'post', data });
// 删除房型
export const deleteRoomTypeDelete = (id: number) =>
  request({ url: '/admin/roomType/delete', method: 'delete', data: { id } });
// 获取房型信息
export const getRoomTypeView = (id: number) =>
  request({ url: '/admin/roomType/view', params: { id } });
